package com.java.oop;

public abstract class Human {
    public abstract void eat();

    public Human(){
        System.out.println();
    }
    public static void main(String[] args) {
//        Chinese chinese = new Chinese();
//        American american = new American();
//        Indian indian = new Indian();
//        chinese.eat();
//        american.eat();
//        indian.eat();

        //多态：父类-->子类对象
        Human man = new American();
        man.eat();
    }
}

class Chinese extends Human{
    @Override
    public void eat() {
        System.out.println("中国人用筷子吃饭");
    }
}
class American extends Human{
    @Override
    public void eat() {
        System.out.println("美国人用刀叉吃饭");
    }
}
class Indian extends Human{
    @Override
    public void eat() {
        System.out.println("印度人用手吃饭");
    }
}